//
//  NSMutableDictionary+Tools.h
//  MiaoPai
//
//  Created by jiaxuzhou on 2017/6/10.
//  Copyright © 2017年 Jeakin. All rights reserved.
//
//


#import <Foundation/Foundation.h>
#import "NSObject+Tools.h"


/// 字典保护
/// 是否NSMutableDictionary类型
#define MPT_mDic_Class(mdic) [mdic isKindOfClass:[NSMutableDictionary class]]

/// 是否有效，不为空，且是NSMutableDictionary类型，且count值大于0
#define MPT_mDic_Is_Valid(mdic) ((MPT_Object_Not_Null(mdic)) && (MPT_mDic_Class(mdic)) && (mdic.count > 0))
/// 是否有效，不为空，且是NSMutableDictionary类型
#define MPT_mDic_Is_Valid_ExceptEmpty(mdic) ((MPT_Object_Not_Null(mdic)) && (MPT_mDic_Class(mdic)))

/// 是否无效，或为空，或不是NSMutableDictionary类型，或count值小于等于0
#define MPT_mDic_Not_Valid(mdic) ((MPT_Object_Is_Null(mdic)) || (!MPT_mDic_Class(mdic)) || (mdic.count <= 0))
/// 是否无效，或为空，或不是NSMutableDictionary类型
#define MPT_mDic_Not_Valid_ExceptEmpty(mdic) ((MPT_Object_Is_Null(mdic)) || (!MPT_mDic_Class(mdic)))
/// 添加字典元素保护
#define MPT_mDic_SetValidObjectForDictionary(dic,key,value) mp_setValidObjectForDictionary(dic,key,value)

@interface NSMutableDictionary (Tools)


void mp_setValidObjectForDictionary(NSMutableDictionary *dic, id key, id value);


@end
